#include "StdAfx.h"
#include "base_project.h"

base_project::base_project(void)
{
}

base_project::~base_project(void)
{
}

IXMLDOMDocument* base_project::create_xml_file(wchar_t* aStrPath)
{
	HRESULT hr;
	IXMLDOMDocument * pXMLDoc;	
	
	hr = CoCreateInstance(CLSID_DOMDocument30, NULL, CLSCTX_INPROC_SERVER, 
		IID_IXMLDOMDocument, (void**)&pXMLDoc);
	if (FAILED(hr))
	{
		AfxMessageBox(L"fail create xml docment");
		return NULL;
	}
	
	VARIANT_BOOL bSuccess = false;
	pXMLDoc->load((_variant_t)aStrPath, &bSuccess);

	return bSuccess?pXMLDoc:NULL;
}

void base_project::destroy_xml_file(IXMLDOMDocument * aDoc)
{
	aDoc->Release();
}